package com.hospital.controller;


import com.hospital.configure.Result;
import com.hospital.entity.HealthInfo;
import com.hospital.service.HealthInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author WuLiting
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/healthInfo")
public class HealthInfoController {

    @Autowired
    HealthInfoService healthInfoService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateHealthInfo")
    public Result<HealthInfo> updateHealthInfo(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.updateHealthInfo(healthInfo);
    }

    /**
     * 删除
     */
    @RequestMapping("/delHealthInfo")
    public Result<HealthInfo> delHealthInfo(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.delHealthInfo(healthInfo);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelHealthInfo")
    public Result<HealthInfo> batchDelHealthInfo(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.batchDelHealthInfo(healthInfo);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryHealthInfo")
    public Result<HealthInfo> queryHealthInfo(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.queryHealthInfo(healthInfo);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/queryHealthInfoByPage")
    public Result<HealthInfo> queryHealthInfoByPage(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.queryHealthInfoByPage(healthInfo);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryHealthInfoById")
    public Result<HealthInfo> queryHealthInfoById(@RequestBody HealthInfo healthInfo) {
        return healthInfoService.queryHealthInfoById(healthInfo);
    }

}

